using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using WikiApp.Models;

namespace WikiApp.Pages
{
    public partial class TemplatePage : BaseContentPage
    {
        public string PageTitle { get; set; }
        private string _yamlFileName;
        private string _pageType;

        protected override string ContentFolder => Path.Combine(Directory.GetCurrentDirectory(), "Pages", $"{_pageType}Page");
        protected override string YamlFileName => _yamlFileName;

        public TemplatePage(string title, string yamlFileName, string pageType)
        {
            InitializeComponent();
            PageTitle = title;
            _yamlFileName = yamlFileName;
            _pageType = pageType;
            DataContext = this;
            LoadContent();
            LoadVersions();
        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
} 